package com.hmall.search.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author macro
 * @Date 2025/7/3  12:29
 * @Description ES配置类 初始化client
 */
@Configuration
public class ESConfig {
    @Bean
    public RestHighLevelClient client() {
        RestClientBuilder clientBuilder = RestClient.builder(HttpHost.create("http://117.72.101.3:9200"));
        return new RestHighLevelClient(clientBuilder);
    }
}